package cate.game.role.pvp.guildwar.msg;

import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBGuildWar;
import cate.game.role.res.guild.po.GuildPO;

@ClientMsg(title = "公会战 战场日志 の 请求")
public class GuildWarLogReq implements MsgInput {

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GuildPO guild = cc.getRole().getRes().guild.getGuild();
        if (guild == null) {
            game.notice.message(cc.getRole(), "尚未加入公会");
            return;
        }
        if (!guild.war.hasMatch()) {
            game.notice.message(cc.getRole(), "公会战尚未开启");
            return;
        }
        cc.getRole().sendNow(new GuildWarLogResp(guild.war));
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBGuildWar.LOG_REQ;
    }
}
